package Agency.views;
import java.awt.Color;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JTextField;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author wangari
 */
public class DeleteHouse extends javax.swing.JFrame {
  static DefaultListModel HouseList = new DefaultListModel();
    /**
     * Creates new form DeleteHouse and sets the background color to light gray
     */
    public DeleteHouse() {
         this.getContentPane().setBackground(Color.LIGHT_GRAY);
        initComponents();
        setLocationRelativeTo(null);
    }
    /**
     * ComboBox to get the house type
     * @return jChousetype
     */
    public JComboBox getHouseType(){
        return jChousetype;
         }
    /**
     * TextField to show the plot number
     * @return jThouseplotnum
     */
    public JTextField getPlotNumber(){
        return jThouseplotnum;
    }
    /**
     * Button to delete 
     * @return jBDelete
     */
    public JButton delete(){
        return jBDelete;
    }
    /**
     * Button to close the view
     * @return jBCloseView
     */
    public JButton closeView(){
        return jBCloseView;
    }
    /**
     * DefaultListModel to return the house to be deleted
     * @return HouseList
     */
    public DefaultListModel gettheList(){
        return HouseList;
    }
    /**
     * Button to confirm whether the house you entered is the one you want to delete
     * @return jBConfirm
     */
   public JButton confirming(){
   return jBConfirm;
     }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLhtype = new javax.swing.JLabel();
        jChousetype = new javax.swing.JComboBox();
        jLplotnum = new javax.swing.JLabel();
        jThouseplotnum = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jLhouselist = new javax.swing.JList();
        jBDelete = new javax.swing.JButton();
        jBCloseView = new javax.swing.JButton();
        jBConfirm = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("Delete House");

        jLhtype.setText("House Type");

        jChousetype.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Apartment", "3Bedroom", "2Bedroom", "1Bedroom", "BedSitter", "SingleRoom" }));

        jLplotnum.setText("House Plot Number");

        jThouseplotnum.setColumns(15);

        jLhouselist.setModel(HouseList);
        jScrollPane1.setViewportView(jLhouselist);

        jBDelete.setText("Delete");
        jBDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBDeleteActionPerformed(evt);
            }
        });

        jBCloseView.setText("Close");

        jBConfirm.setText("Confirm");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLhtype)
                                .addComponent(jLplotnum))
                            .addGap(75, 75, 75)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jThouseplotnum)
                                .addComponent(jChousetype, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGroup(layout.createSequentialGroup()
                            .addGap(212, 212, 212)
                            .addComponent(jLabel1)))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jBConfirm)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jBDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(59, 59, 59)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 382, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBCloseView))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(57, 57, 57)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLhtype)
                            .addComponent(jChousetype, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jThouseplotnum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLplotnum))
                        .addGap(120, 120, 120))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 35, Short.MAX_VALUE)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 64, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jBCloseView)
                            .addComponent(jBDelete)
                            .addComponent(jBConfirm))
                        .addGap(28, 28, 28))))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBDeleteActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jBDeleteActionPerformed

  

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBCloseView;
    private javax.swing.JButton jBConfirm;
    private javax.swing.JButton jBDelete;
    private javax.swing.JComboBox jChousetype;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JList jLhouselist;
    private javax.swing.JLabel jLhtype;
    private javax.swing.JLabel jLplotnum;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jThouseplotnum;
    // End of variables declaration//GEN-END:variables
}
